<HTML><HEAD><TITLE>rotate(?X, ?C, ?Y)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(ic_symbolic)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>rotate(?X, ?C, ?Y)</H1>
Y is C places after X in the (cyclic) domain order
<DL>
<DT><EM>X</EM></DT>
<DD>variable or domain value
</DD>
<DT><EM>C</EM></DT>
<DD>variable or integer
</DD>
<DT><EM>Y</EM></DT>
<DD>variable or domain value
</DD>
</DL>
<H2>Description</H2>

	Constrains X and Y such that Y is C positions after X in the domain
	order, where the order is considered cyclic, i.e. the first domain
	element follows the last one. Because of the cyclic order, for each
	pair of X and Y there are infinitely many solutions for C (which
	are identical modulo the domain size).
	X and Y must be variables or values of the same domain. If one of
	them is domain-less, it will be given the same domain as the other.
	<P>
	The implementation currently achieves only bounds-consistency.

<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H2>Examples</H2>
<PRE>
    ?- [X,Y] &amp;:: weekday, rotate(X,1,Y).
    X = X{[mo, tu, we, th, fr, sa, su]}
    Y = Y{[mo, tu, we, th, fr, sa, su]}
    There is 1 delayed goal.
    Yes (0.00s cpu)

    ?- rotate(th,1,fr).
    Yes (0.00s cpu)

    ?- rotate(su,2,tu).
    Yes (0.00s cpu)

    ?- rotate(su,9,tu).
    Yes (0.00s cpu)

    ?- rotate(X,1,fr).
    X = th
    Yes (0.00s cpu)

    ?- rotate(su,50,X).
    X = mo
    Yes (0.00s cpu)

    ?- rotate(su,-1,X).
    X = sa
    Yes (0.00s cpu)

    ?- rotate(tu,1,th).
    No (0.00s cpu)

    ?- ic:(X::0..7), rotate(tu,X,fr).
    X = 3
    Yes (0.00s cpu)

    ?- ic:(X::2..4), rotate(tu,X,Y).
    X = X{2 .. 4}
    Y = Y{[th, fr, sa]}
    Delayed goals: ...

    ?- rotate(X,1,Y).
    Arguments have no domains in rotate(X, 1, Y) in module eclipse
    Abort

    ?- X &amp;:: weekday, rotate(X, 1, red).
    Arguments have different domains (weekday,colour) in rotate(X, 1, red) ...
    Abort
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/ic_symbolic/rotate-4.html">rotate / 4</A>, <A HREF="../../lib/ic_symbolic/YL-2.html">&< / 2</A>, <A HREF="../../lib/ic_symbolic/YG-2.html">&> / 2</A>, <A HREF="../../lib/ic_symbolic/YEL-2.html">&=< / 2</A>, <A HREF="../../lib/ic_symbolic/YGE-2.html">&>= / 2</A>, <A HREF="../../lib/ic_symbolic/YE-2.html">&= / 2</A>, <A HREF="../../lib/ic_symbolic/YRE-2.html">&\= / 2</A>, <A HREF="../../lib/ic_symbolic/shift-3.html">shift / 3</A>, <A HREF="../../kernel/termcomp/domain-1.html">domain / 1</A>
</BODY></HTML>
